﻿#include "dxstdafx.h"
#include "DataMgr.h"
#include "ScriptData/ScriptDataMgr.h"
#include "ProgramData/ProgramDataMgr.h"

CDataMgr::CDataMgr()
{
	try
	{
		m_pScriptDataMgr = new CScriptDataMgr();
		m_pProgramDataMgr = new CProgramDataMgr();
	}
	catch (std::bad_alloc &memExp)
	{
		abort();
	}
}

CDataMgr::~CDataMgr()
{
	SAFE_DELETE(m_pScriptDataMgr);
	SAFE_DELETE(m_pProgramDataMgr);
}

void CDataMgr::InitData()
{
	m_pScriptDataMgr->LoadScript();
	m_pProgramDataMgr->InitData();		//ProgramData要在ScriptData后Init
}

const CLocalisation* CDataMgr::GetLocalisationCPtr() const
{
	return m_pScriptDataMgr->GetLocalisationCPtr();
}
